<?php
Header('Cache-Control: no-cache');
Header('Pragma: no-cache');
Header('X-UA-Compatible: IE=9');

session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Aufenthaltsorte</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<link rel="icon" href="icons/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript"
	src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="javascript/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="javascript/mapscript.js.php"
	charset="utf-8">
    </script>
<script type="text/javascript">
    	editMode = 0;
    </script>
</head>
<body>
	<?php 
	require_once 'navbar.php';

	if (!isset($_SESSION['userid']))
	{
		$db->showMsg(false,"");
		exit;
	}
	?>

	<table>
		<tr>
			<?php
			$types = $db->getWhereaboutTypes();
			while ($row = $types->fetch_assoc())
			{
				echo '<th class="icon">'.$row['name']."</th>\n";
			}
			?>
			<th class="other">J&auml;ger</th>
			<th class="other">Revier</th>
			<th class="other">Typ</th>
		</tr>
		<tr>
			<?php		
			$types->data_seek(0);
			while ($row = $types->fetch_assoc())
			{
				echo '<td><img src="'.$row['icon'].'" alt="markerIcon" /></td>'."\n";
			}
			?>
			<!-- J&auml;ger -->
			<td>
				<form name="hunter">
					<select name="hunterid" size="1" onchange="onHunterChanged();">
						<option value="0">Bitte ausw&auml;hlen</option>
						<?php
						$hunters = $db->getHunters();

						while ($row = $hunters->fetch_assoc())
						{
							echo '<option value="' . $row['id'] . '">'.$row['name']." ".$row['firstname']."</option>\n";
						}
						?>
					</select>
				</form>
			</td>

			<!-- Reviere -->
			<td>
				<form name="district">
					<select name="districtid" size="1" disabled="true"
						onchange="onDistrictChanged();">
						<option value="0">Bitte ausw&auml;hlen</option>
					</select>
				</form>
			</td>

			<!-- Typen -->
			<td><form name="type">
					<select name="typeid" size="1" disabled="true"
						onchange="onTypeChanged();">

						<?php
						$types->data_seek(0);
						while ($row = $types->fetch_assoc())
						{
							echo '<option value="'.$row['id'].'">'.$row['name']."</option>\n";
						}
						?>

					</select>
				</form></td>
		</tr>
	</table>
	<div id="map_canvas"></div>
	<div id="loadingbg">
		<img id="loadingimg" src="icons/ajax-loader.gif" alt="loading" />
	</div>
</body>
</html>
